/**************************************************************************************************/
/* Game.hpp                                                                               Version */
/* Author     : Ravi Kamath                                                                       */
/* Created    : 30-09-2012                                                                        */
/**************************************************************************************************/
/* The basic class for a Game. Over a period of time, this class will incorporate all things that */
/* is needed for developing a game.                                                               */
/**************************************************************************************************/
/* Todos or other information like known issues and bugs go here                                  */
/**************************************************************************************************/
#ifndef __OLORIN_GAME__
#define __OLORIN_GAME__

#include <DLL.hpp>
#include <windows.h>
#include <GL/glew.h>
#include <IUpdateable.hpp>
#include <IDrawable.hpp>
#include <GraphicsDevice.hpp>

using namespace Olorin::Graphics;

namespace Olorin
	{
	namespace Game
		{
		class DLLAPI Game : public IUpdateable, public IDrawable
			{
			protected:
				GraphicsDevice graphicsDevice;

				HINSTANCE hInstance;
				HWND hWindow;
				HDC hDeviceContext;
				HGLRC hGLRC;
				
				unsigned int width;		// need a structure (possible a rectangle) for
				unsigned int height;	// this information
				
				void enableOpenGL();
				void disableOpenGL();
				
				static LRESULT CALLBACK StaticWindowProc(HWND, UINT, WPARAM, LPARAM);
				virtual LRESULT WindowProc(HWND, UINT, WPARAM, LPARAM);
			public:
				Game();
				virtual ~Game();
				
				virtual void init(HINSTANCE, HWND);
				virtual void update(const GameTime& gameTime);
				virtual void draw(const GameTime& gameTime);
				
				virtual void updateMouseMove(WPARAM, LPARAM);
				virtual void updateMouseWheel(WPARAM, LPARAM);
				virtual void updateMouseClick(WPARAM, LPARAM);
				virtual void updateKeyDown(WPARAM, LPARAM);
				virtual void updateKeyUp(WPARAM, LPARAM);
				
				void resize(const unsigned int&, const unsigned int&);
				void setMode(const unsigned int&);	// examples: full screen, color mode, etc.
			};
		}
	}

#endif